package com.pro.controller;

import com.pro.pojo.JsMenu;
import com.pro.pojo.JsUser;
import com.pro.pojo.JsonData;
import com.pro.service.JsDictService;
import com.pro.service.JsUserService;
import com.pro.utils.RedisCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Set;
import java.util.logging.Logger;

@Controller
@RequestMapping("home")
public class JsDictController {

    @Autowired
    private JsDictService jsDictService;

    @Autowired
    private JsUserService jsUserService;

    /**
     *
     * @param type 导航栏所属类型
     * @return
     */
    @RequestMapping("getNav")
    @ResponseBody
    public JsonData getDictNav(String type){
        JsonData jsonData = new JsonData();
        List<JsMenu> navData = jsDictService.getNavCache(type);
        //缓存清除
        //GuavaUtil.getTenCacheBuild().invalidate(String.valueOf(GuavaCommon.Nav));
        return navData!=null? JsonData.buildSuccess(navData): JsonData.buildError("服务端错误");

    }
}
